import query from '@dfeidao/atom-nodejs/db/query';
import { IncomingHttpHeaders } from 'http';
import { productid, systemid } from '../../atom/config';

interface Message {
	meeting_no: string;
}

export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders) {
	const p = query(action_id, session_id, systemid);
	// 会议状态--会议主题
	p.prepare('meeting_administration', ['meeting_status', 'meeting_name', 'meeting_host', 'start_time',
		'finish_time', 'meeting_address', 'conference_theme'], { productid, meeting_no: message.meeting_no }, 200, 1, [], []);
	// 附件名称、附件文件
	p.prepare('conference_annex', ['annex_name', 'annex_file'], { productid, meeting_no: message.meeting_no }, 200, 1, [], []);
	// 会议决议编号、会议决议内容
	p.prepare('meeting_conclusion', ['conference_reso_no', 'conference_reso_content'], { productid, meeting_no: message.meeting_no }, 200, 1, [], []);
	const [d1, d2, d3] = await p.exec();
	return { d1, d2, d3 };
}
